<!DOCTYPE html>
<html ng-app="app">
<head>
    <meta charset="utf-8">
    <title>设置密码</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" href="__STATIC__/index/css/mui.min.css">
    <link rel="stylesheet" href="__STATIC__/index/css/commen.css" />
    <link rel="stylesheet" href="__STATIC__/index/css/my/account/change_password.css" /><style type="text/css">
    .change_password{padding:0 15px;}
</style>
</head>
<body ng-controller="change_password_controller">
<header class="mui-bar mui-bar-nav">
    <a class="mui-icon mui-icon-left-nav mui-pull-left" onclick="javascript :history.back(-1);"></a>
    <h1 class="mui-title">设置密码</h1>
</header>
<div id="pullrefresh" class="mui-content">
    <div class="change_password">
        <p class="into_title">输入密码:</p>
        <input type="password" class="init_input" id="password"  placeholder="输入密码" />
        <p class="into_title">确认密码:</p>
        <input type="password" class="init_input"  id="repass"  placeholder="请再次确认" />
        <button class="btn btn_orange" onclick="cclick()">确定</button>
    </div>
</div>
<script src="__STATIC__/index/js/mui.min.js"></script>
<script src="__STATIC__/index/js/jquery.min.js"></script>
<script src="__STATIC__/index/js/angular.min.js"></script>
<script src="__STATIC__/index/js/my/account/change_password.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
</body>
</html>
<script type="text/javascript">
    function cclick() {
        var password = $("#password").val();
        var repass = $('#repass').val();
        if(password==''){
            layer.msg('密码不能为空');
        }else if (repass == '') {
            layer.msg('请再次确认');
        }else if(repass!= password){
            layer.msg('两次密码不一致');
        }else{
            $.post("{:url('user/setpass')}", {password: password, repass: repass },
                function (data) {
                    if (data.code == 1) {
                        layer.msg(data.msg, { time: 1000 }, function () {
                            //操作事件
                            window.location.href = "{:url('user/congratulations')}";
                        })
                    } else {
                        layer.msg(data.msg);
                    }
                });
        }
    }
</script>